package com.visionork.android.tai.model;

import java.util.ArrayList;
import java.util.Collection;

import com.visionork.android.tai.model.adapter.FavoriteProgramAdapter;
import com.visionork.android.tai.model.adapter.TaiAdapterBase;

public class FavoriteProgramRepository extends ProgramRepositoryBase {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static final String HOME_URL = null;

	public FavoriteProgramRepository() {

	}

	@Override
	public ArrayList<Program> getPrograms(boolean useCache) {
		if (!useCache) {
			@SuppressWarnings("unchecked")
			Collection<? extends Program> data = (Collection<? extends Program>) getDataAdapter()
					.getData();
			programs.clear();
			programs.addAll(data);
		}
		return programs;
	}

	@Override
	protected String getConfigFileName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected TaiAdapterBase getDataAdapter() {
		if (dataAdapter == null) {
			dataAdapter = new FavoriteProgramAdapter(HOME_URL);
		}
		return dataAdapter;
	}

}
